<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0041)http://www.ewebvn.com/demo/div-three-col/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <title>Wedding studio</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="../source/resizeimg/jquery.nailthumb.1.1.css" type="text/css" />
        <script type="text/javascript" src="../source/resizeimg/jquery.nailthumb.1.1.js"></script>
        
        <link rel="stylesheet" type="text/css" href="../source/galleryshow2/css/default.css" />
		<link rel="stylesheet" type="text/css" href="../source/galleryshow2/css/bookblock.css" />
		<!-- custom demo style -->
		<link rel="stylesheet" type="text/css" href="../source/galleryshow2/css/demo1.css" />
		<script src="../source/galleryshow2/js/modernizr.custom.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
		<script src="../source/galleryshow2/js/jquerypp.custom.js"></script>
		<script src="../source/galleryshow2/js/jquery.bookblock.js"></script>
        
        <!-- We only want the thunbnails to display when javascript is disabled -->
		<script type="text/javascript">
			document.write('<style>.noscript { display: none; }</style>');
		</script>
        <style type="text/css" media="screen">
                .square {
                    width: 75px;
                    height: 75px;
                }
                .showlink {
                    width: 700px;
                    height: 500px;
                }
                 </style>          
</head>
<?php include("../source/header.php"); ?>
<?php

    function list_files($directory)
    {
        if ($directory != '.')
        {
            $directory = rtrim($directory, '/') . '/';
        }
        
        if ($handle = opendir($directory))
        {
            while (false !== ($file = readdir($handle)))
            {
                if ($file != '.' && $file != '..')
                {
                    echo	'<div class="bb-item">
							     <img class="nailthumb-container showlink" src="'.$directory.$file.'"/>
						     </div>';
                }
            }
            
            closedir($handle);
        }
    }
?>
<br />
			<div class="main clearfix">
				<div class="bb-custom-wrapper">
					<div id="bb-bookblock" class="bb-bookblock">
						<?php
                            if(isset($_POST['pathalbum'])){
                                $path = '../upload/albumcuoi/'.$_POST['pathalbum'];
                                list_files($path);
                            }
                        ?>
					</div>
					<nav>
						<a id="bb-nav-first" href="#" class="bb-custom-icon bb-custom-icon-first">First page</a>
						<a id="bb-nav-prev" href="#" class="bb-custom-icon bb-custom-icon-arrow-left">Previous</a>
						<a id="bb-nav-next" href="#" class="bb-custom-icon bb-custom-icon-arrow-right">Next</a>
						<a id="bb-nav-last" href="#" class="bb-custom-icon bb-custom-icon-last">Last page</a>
					</nav>
				</div>
			</div>
		</div><!-- /container -->

		<?php
            if(isset($_POST['urlalbum'])){
				$url = $_POST['urlalbum'];
			}
        ?>
		
        <div style="float:left; width:90%; margin-top:20px;">
              <h3 align="left">
                <table width="855" border="0">
                  <tbody><tr>
                    <td width="20%" height="53"></td>
                    <td width="219"><a href="javascript:history.back(1)"><img width="48" height="48" alt="" src="../image/back_button.png"></a><strong>Quay lai</strong></td>
					<td width="219"><a href="#" onclick="javascript:window.location.href='<?php echo "http://".$url;?>'" >download</a></td>
                  </tr>
                </tbody></table></h3>
            </div>
        
<?php include("../source/footer.php"); ?>		
		<script>
			var Page = (function() {
				
				var config = {
						$bookBlock : $( '#bb-bookblock' ),
						$navNext : $( '#bb-nav-next' ),
						$navPrev : $( '#bb-nav-prev' ),
						$navFirst : $( '#bb-nav-first' ),
						$navLast : $( '#bb-nav-last' )
					},
					init = function() {
						config.$bookBlock.bookblock( {
							speed : 800,
							shadowSides : 0.8,
							shadowFlip : 0.7
						} );
						initEvents();
					},
					initEvents = function() {
						
						var $slides = config.$bookBlock.children();

						// add navigation events
						config.$navNext.on( 'click touchstart', function() {
							config.$bookBlock.bookblock( 'next' );
							return false;
						} );

						config.$navPrev.on( 'click touchstart', function() {
							config.$bookBlock.bookblock( 'prev' );
							return false;
						} );

						config.$navFirst.on( 'click touchstart', function() {
							config.$bookBlock.bookblock( 'first' );
							return false;
						} );

						config.$navLast.on( 'click touchstart', function() {
							config.$bookBlock.bookblock( 'last' );
							return false;
						} );
						
						// add swipe events
						$slides.on( {
							'swipeleft' : function( event ) {
								config.$bookBlock.bookblock( 'next' );
								return false;
							},
							'swiperight' : function( event ) {
								config.$bookBlock.bookblock( 'prev' );
								return false;
							}
						} );

						// add keyboard events
						$( document ).keydown( function(e) {
							var keyCode = e.keyCode || e.which,
								arrow = {
									left : 37,
									up : 38,
									right : 39,
									down : 40
								};

							switch (keyCode) {
								case arrow.left:
									config.$bookBlock.bookblock( 'prev' );
									break;
								case arrow.right:
									config.$bookBlock.bookblock( 'next' );
									break;
							}
						} );
					};

					return { init : init };

			})();
		</script>
		<script>
				Page.init();
		</script>